#!/bin/bash

file_path=~/Downloads/dajingxi.csv  # 替换成你的文件路径

while IFS= read -r line; do
    # 使用制表符或空格进行分割
    IFS=$'\t' read -r code order_no <<< "$line"
    # 在这里可以使用 param1 和 param2 进行你的操作
    echo "Param1: $code, Param2: $order_no"
    mysql --defaults-group-suffix=.lk.admin --column-names=false lk_"$code" -e "UPDATE opr_pickup SET flag = 512 WHERE order_no = '$order_no';"
    mysql --defaults-group-suffix=.lk.admin --column-names=false lk_"$code" -e "UPDATE opr_product SET flag = 512 WHERE pickup_id in (select id from opr_pickup where order_no = '$order_no')"
    mysql --defaults-group-suffix=.lk.admin --column-names=false lk_"$code" -e "UPDATE opr_merchandise SET flag = 512 WHERE pickup_id in (select id from opr_pickup where order_no = '$order_no')"
done < "$file_path"
